import requests
import re
import time
import json


def get_one_page(url):
    try:
        headers = {
            'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) '
                          'Chrome/94.0.4606.81 Safari/537.36 ',
            '': ''
        }

        response = requests.get(url, headers=headers)
        if response.status_code == 200:
            return response.text
        return None
    except requests.exceptions.RequestException:
        return None


def parse_one_page(html):
    pattern = re.compile('<dd>.*?board-index.*?>(.*?)</i>.*?', re.S)


def main():
    for i in range(0, 10, 10):
        url = 'https://maoyan.com/board/4?offset=' + i
        html = get_one_page(url)
